using System;
using Newtonsoft.Json;
using System.Text;
using System.Data;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;

namespace ST.Buz.Base.Entity
{
	/// <summary>
	/// 合作伙伴信息（客户、供应商）
	/// </summary>
	[Serializable]
	[Table("IMS_Partner")]
	public partial class IMS_Partner
	{
		/// <summary>
		/// 
		/// </summary>
		[Key]
		[Column("ID")]
		public int ID { get; set; }

		/// <summary>
		/// 类别ID
		/// </summary>
		[Column("CatID")]
		public int CatID { get; set; }

		/// <summary>
		/// 合作伙伴类型（客户、供应商）
		/// </summary>
		[Column("Type")]
		public int Type { get; set; }

		/// <summary>
		/// 编号
		/// </summary>
		[Column("Code")]
		[StringLength(32, ErrorMessage = "编号长度最长为{1}个字符")]
		public string Code { get; set; }

		/// <summary>
		/// 名称
		/// </summary>
		[Column("Name")]
		[StringLength(120, ErrorMessage = "名称长度最长为{1}个字符")]
		public string Name { get; set; }

		/// <summary>
		/// 拼音助记码
		/// </summary>
		[Column("PYCode")]
		[StringLength(10, ErrorMessage = "{0}长度不能超过{1}")]
		public string PYCode { get; set; }

		/// <summary>
		/// 公司电话
		/// </summary>
		[Column("Phone")]
		[StringLength(30, ErrorMessage = "{0}长度不能超过{1}")]
		public string Phone { get; set; }

		/// <summary>
		/// 传真号码
		/// </summary>
		[Column("Fax")]
		[StringLength(30, ErrorMessage = "{0}长度不能超过{1}")]
		public string Fax { get; set; }

		/// <summary>
		/// 联系人
		/// </summary>
		[Column("ContactMan")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		public string ContactMan { get; set; }

		/// <summary>
		/// 联系电话
		/// </summary>
		[Column("ContactPhone")]
		[StringLength(30, ErrorMessage = "{0}长度不能超过{1}")]
		public string ContactPhone { get; set; }

		/// <summary>
		/// 电子邮箱地址
		/// </summary>
		[Column("Email")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Email { get; set; }

		/// <summary>
		/// 国家
		/// </summary>
		[Column("Country")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Country { get; set; }

		/// <summary>
		/// 省
		/// </summary>
		[Column("Province")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Province { get; set; }

		/// <summary>
		/// 市
		/// </summary>
		[Column("City")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string City { get; set; }

		/// <summary>
		/// 区、县
		/// </summary>
		[Column("District")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string District { get; set; }

		/// <summary>
		/// 乡镇、街道
		/// </summary>
		[Column("Town")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Town { get; set; }

		/// <summary>
		/// 详细地址
		/// </summary>
		[Column("Location")]
		[StringLength(100, ErrorMessage = "{0}长度不能超过{1}")]
		public string Location { get; set; }

		/// <summary>
		/// 邮编
		/// </summary>
		[StringLength(10, ErrorMessage = "{0}长度不能超过{1}")]
		[Column("ZipCode")]
		public string ZipCode { get; set; }

		/// <summary>
		/// QQ号
		/// </summary>
		[StringLength(15, ErrorMessage = "{0}长度不能超过{1}")]
		[Column("QQ")]
		public string QQ { get; set; }

		/// <summary>
		/// 微信号
		/// </summary>
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		[Column("WX")]
		public string WX { get; set; }

		/// <summary>
		/// 出生日期
		/// </summary>
		[Column("BirthDate")]
		public DateTime? BirthDate { get; set; }

		/// <summary>
		/// 身份证号
		/// </summary>
		[Column("IDCardNo")]
		[Display(Name = "身份证号")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		[RegularExpression(@"^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$", ErrorMessage = "身份证号格式不正确")]
		public string IDCardNo { get; set; }

		/// <summary>
		/// 性别（0：未知，1：男：2：女）
		/// </summary>
		[Column("Gender")]
		public int Gender { get; set; }

		/// <summary>
		/// 开户行
		/// </summary>
		[Column("BankName")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string BankName { get; set; }

		/// <summary>
		/// 开户人
		/// </summary>
		[Column("BankAccountName")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		public string BankAccountName { get; set; }

		/// <summary>
		/// 银行卡号
		/// </summary>
		[Column("BankAccountNo")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		[RegularExpression(@"^\d{16,20}$", ErrorMessage = "卡号有误")]
		public string BankAccountNo { get; set; }

		/// <summary>
		/// 开户行地址
		/// </summary>
		[Column("BankAddress")]
		[StringLength(60, ErrorMessage = "{0}长度不能超过{1}")]
		public string BankAddress { get; set; }

		/// <summary>
		/// 备注
		/// </summary>
		[Column("Comment")]
		[StringLength(100, ErrorMessage = "{0}长度不能超过{1}")]
		public string Comment { get; set; }

		/// <summary>
		/// 状态
		/// </summary>
		[Column("StateNow")]
		public int StateNow { get; set; }

		/// <summary>
		/// 排序（值越小排序越靠前）
		/// </summary>
		[Column("Sort")]
		public int Sort { get; set; }

		/// <summary>
		/// 总充值金额
		/// </summary>
		[Column("TotalCashIn")]
		public decimal TotalCashIn { get; set; }

		/// <summary>
		/// 总充值赠送金额
		/// </summary>
		[Column("TotalCashBonus")]
		public decimal TotalCashBonus { get; set; }

		/// <summary>
		/// 总消费金额
		/// </summary>
		[Column("TotalCashOut")]
		public decimal TotalCashOut { get; set; }

		/// <summary>
		/// 总余额
		/// </summary>
		[Column("TotalCashBalance")]
		public decimal TotalCashBalance { get; set; }

		/// <summary>
		/// 累计获得积分
		/// </summary>
		[Column("TotalPointsIn")]
		public int TotalPointsIn { get; set; }

		/// <summary>
		/// 累计使用积分
		/// </summary>
		[Column("TotalPointsOut")]
		public int TotalPointsOut { get; set; }

		/// <summary>
		/// 累计剩余积分
		/// </summary>
		[Column("TotalPointsBalance")]
		public int TotalPointsBalance { get; set; }

		/// <summary>
		/// 挂账额度
		/// </summary>
		[Column("DebtLimit")]
		public decimal DebtLimit { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		[Column("AddDate")]
		public DateTime AddDate { get; set; }

		/// <summary>
		/// 创建人ID
		/// </summary>
		[Column("AddManID")]
		[JsonIgnore]
		public int AddManID { get; set; }

		/// <summary>
		/// 创建人
		/// </summary>
		[Column("AddManName")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		public string AddManName { get; set; }

		/// <summary>
		/// OrgID
		/// </summary>
		[JsonIgnore]
		[Column("OrgID")]
		public int OrgID { get; set; }
	}
}

